<%@ Page Language="C#" MasterPageFile="~/FiledbookMaster.Master" AutoEventWireup="true" CodeBehind="Messages.aspx.cs" Inherits="Fieldbook.Testwebsite.User.Messages" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    Messages
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" CellPadding="4"
        DataSourceID="MessgesODS"
        PageSize="7" AutoGenerateColumns="False"
        ForeColor="#333333" GridLines="None">
        <Columns>            
            <asp:BoundField DataField="Caption" HeaderText="Caption" SortExpression="Caption" />
            <asp:CheckBoxField DataField="Messagereadstatus" HeaderText="Messagereadstatus" SortExpression="Messagereadstatus" />
            <asp:BoundField DataField="Content" HeaderText="Content" SortExpression="Content" />
            <asp:BoundField DataField="Receiverid" HeaderText="Receiverid" SortExpression="Receiverid"/>
            <asp:TemplateField>
            <ItemTemplate>
            <asp:LinkButton runat="server" ID="editButton" OnCommand="editButton_Command" Text="Edit" CommandArgument='<%# Eval("Messageid") %>'/>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    
    <asp:Panel runat="server" id="EditPanel" Visible="false">
     <asp:HiddenField runat="server" ID="hiddenMessageID" />   
     Caption:  
     <asp:TextBox runat="server" ID="txtCaption" />
     <br />
     Content:  
     <asp:TextBox runat="server" ID="txtContent" Rows="5" TextMode="MultiLine"/>
     <br />
     <asp:LinkButton runat="server" ID="updateMsg" Text="Update" />
    </asp:Panel>

    <asp:ObjectDataSource ID="MessgesODS" runat="server" TypeName="Fieldbook.Business.MessageController"
        DataObjectTypeName="Fieldbook.Entities.Message" SelectMethod="LoadUserMessages"
        SelectCountMethod="GetMessagesCount" EnablePaging="True">
        <SelectParameters>
            <asp:SessionParameter Name="userID" Type="Int64" SessionField="userID" />
            <asp:Parameter Name="maximumRows" Type="Int32" DefaultValue="7" />
            <asp:Parameter Name="startRowIndex" Type="Int32" DefaultValue="0" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
